/**
 * Created by Intellij IDEA
 *
 * @author 王俊凯
 * @Date: 2023/2/28 9:19
 * @Version 1.0
 */
package com.eight.controller;

import com.eight.pojo.TbCarComment;
import com.eight.service.CarCommentService;
import com.eight.vo.CarVo;
import com.eight.vo.ComResult;
import kotlin.contracts.Returns;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rent/comment")
public class CarCommentController {

    @Autowired
    private CarCommentService carCommentService;

    @RequestMapping("/list")
    public ComResult list(@RequestBody CarVo carVo){
        ComResult selectComment = carCommentService.selectComment(carVo);
        return selectComment;
    }

    @RequestMapping("/insert")
    public ComResult insert(@RequestBody TbCarComment tbCarComment){
        ComResult insertComment = carCommentService.insertComment(tbCarComment);
        return insertComment;
    }

    @RequestMapping("/update")
    public ComResult update(@RequestBody TbCarComment tbCarComment){
        ComResult updateComment = carCommentService.updateComment(tbCarComment);
        return updateComment;
    }

    @RequestMapping("/delete")
    public ComResult delete(int id){
        ComResult deleteComment = carCommentService.deleteComment(id);
        return deleteComment;
    }


    @RequestMapping("/selectContent")
    public ComResult selectContent(@RequestBody TbCarComment tbCarComment){
        ComResult selectContent = carCommentService.selectContent(tbCarComment);
        return selectContent;
    }

}

